package com.xcm.sso;

/**
 * 业务系统名称常量类
 *
 * @author linqiang
 * @date 2018-04-13 9:15
 */
public class SSOContants {
    /**
     * 登录成功后的回调地址
     */
    public static final String REDIRECT_URL = "gotoURL";
    /**
     * 登录成功后的设置cookie的地址
     */
    public static final String SET_COOKIE_URL = "setCookieURL";
    /**
     * 系统标识
     */
    public static final String PLATFORM_TAG = "platformTag";
    /**
     * 票据
     */
    public static final String TICKET = "ticket";
    /**
     * 过期时间
     */
    public static final String EXPIRY = "expiry";
    /**
     * 密码
     */
    public static final String PASSWORD = "password";
    /**
     * 新密码
     */
    public static final String NEW_PASSWORD = "newPassword";

    public static final String USER_NAME = "userName";
    public static final String REAL_NAME = "realName";
    public static final String UID = "uid";
    public static final String USER = "user";
    /**
     * ticket有效时间-7天
     */
    public static int TICKET_TIME_OUT = 7 * 24 * 3600;
    /**
     * ticket有效时间-不过期
     */
    public static int TICKET_TIME_OUT_NEVER = -1;
    /**
     * 自动授权
     */
    public static String AUTO_AUTH = "1";

    /**
     * 提示语-ticket过期
     */
    public static String MSG_TICKET_TIME_OVER = "ticket已过期，请重新登录";

    /**
     * 提示语-验证ticket成功
     */
    public static String MSG_CHECK_TICKET_SUCCESS = "验证ticket成功";
    /**
     * 提示语-验证ticket失败
     */
    public static String MSG_CHECK_TICKET_FAIL = "验证ticket失败";
    /**
     * 提示语-ticket不能为空
     */
    public static String MSG_NO_TICKET = "ticket不能为空";

    /**
     * 提示语-ticket不存在
     */
    public static String MSG_TICKET_NOT_EXITS = "ticket不存在";

    /**
     * 提示语-ticket已过期
     */
    public static String MSG_TICKET_EXPIRE = "ticket已过期";

    /**
     * 提示语-设置cooklie失败
     */
    public static String MSG_SET_COOKIE_FAIL = "设置cookie失败";

    /**
     * 提示语-未登录
     */
    public static String MSG_NOT_LOGIN = "您尚未登录，请先登录!";

    /**
     * 提示语-gotoURL不能为空
     */
    public static String MSG_NO_GOTO_URL = "回调地址gotoURL不能为空";
    /**
     * 提示语-系统不存在
     */
    public static String MSG_NO_SYSTEM = "统一账户管理系统暂未添加此系统，请联系管理员";
    /**
     * 提示语-系统标志错误
     */
    public static String MSG_SYSTEM_SIGN_ERROR = "系统标志错误，请联系管理员确认";
    /**
     * 提示语-回调地址错误
     */
    public static String MSG_GOTO_URL_ERROR = "回调地址错误";
    /**
     * 提示语-无权访问系统
     */
    public static String MSG_NO_AUTHORITY = "您在该系统无权限访问，请联系管理员";
    /**
     * 提示语-获取登录用户信息失败
     */
    public static String MSG_GET_LOGIN_USER_INFO_ERROR = "获取登录用户信息失败";

    /**
     * 系统登录页面
     */
    public enum PATH {
        //SSO页面
        LOGIN_PAGE_PORTAL("LOGIN_PAGE_PORTAL", "portalLogin"),
        LOGIN_PAGE_MIPS("LOGIN_PAGE_MIPS ", "mipsLogin"),
        LOGIN_PAGE_DMP("LOGIN_PAGE_DMP ", "dmpLogin"),
        LOGIN_PAGE_XCIPS("LOGIN_PAGE_XCIPS", "xcipsLogin"),

        //统一账户管理系统本地方法
        PORTAL_METHOD_INDEX("PORTAL_INDEX", "/index"),
        PORTAL_METHOD_LOGOUT("PORTAL_LOGOUT_METHOD", "/logout"),
        PORTAL_METHOD_SETCOOKIE("PORTAL_LOGOUT_METHOD", "/setCookie"),

        //其他页面
        PAGE_404("404", "404"),
        PAGE_401("401", "401"),

        //方法
        //预登录
        SSO_METHOD_PRE_LOGIN("SSO_PRE_LOGIN_METHOD", "/preLogin"),
        //验证ticket
        SSO_METHOD_AUTH_TICKET("SSO_AUTH_TICKET_METHOD", "/authTicket"),
        //表单登录
        SSO_METHOD_FORM_LOGIN("SSO_FORM_LOGIN_METHOD", "/formLogin"),
        //修改密码
        SSO_METHOD_CHANGE_PASSWORD("SSO_CHANGE_PASSWORD_METHOD", "/changePassword");

        private final String name;
        private final String value;

        PATH(String name, String value) {
            this.name = name;
            this.value = value;
        }

        public String getName() {
            return this.name;
        }

        public String getValue() {
            return this.value;
        }
    }
}
